package com.choosefine.it.worker.model;

import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.List;

import javax.persistence.Id;

import org.springframework.data.mongodb.core.mapping.Document;

import com.choosefine.it.base.Base;
import com.choosefine.it.basedata.model.ProjectInfo;
import com.choosefine.it.basedata.model.WorkType;
import com.choosefine.it.team.model.ItemInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 工人所在项目-班组关联表
 * 
 * @auth liaozhanggen 2016-11-21 下午7:29:20
 *
 */
@Document(collection = "qh_worker_items_relation")
public class WorkerItemsRelation extends Base {

	private static final long serialVersionUID = -5299681398550700877L;
	
	@Id
	private Integer id;

//	/**
//	 * user code用户编码
//	 */
//	@JsonProperty("user_code")
//	@Field("user_code")
//	private String userCode;
	
	/**
	 * 项目详情中的project code 项目的唯一标识
	 */
	@ApiModelProperty(value = "项目的唯一标识")
	private String projectCode;
	
	/**
	 * 项目详情中
	 */
	@ApiModelProperty(value = "项目详情中")
	private ProjectInfo projectInfo;
	
	/**
	 * 班组详情信息中的 主键 id
	 */
	@ApiModelProperty(value = "班组详情；eg:水电班")
	private Integer teamId;
	
	/**
	 * 班组信息
	 */
	@ApiModelProperty(value = "班组信息")
	private ItemInfo itemInfo;
	
	/**
	 * 工作种类外键
	 */
	@ApiModelProperty(value = "工作种类： eg :水电工、水泥工")
	private Integer workTypeId;

	private WorkType workType;
	
//	/**
//	 * 工作种类： eg :水电工、水泥工
//	 */
//	@JsonProperty("work_type_name")
	@ApiModelProperty(value = "工作种类名称： eg :水电工、水泥工")
	private String workTypeName;
	
	// add by juchengyang 2017/2/17
	@ApiModelProperty(value = "工程地区", required = false)
	private String projectArea;
	
	// add by juchengyang 2017/2/17
	@ApiModelProperty(value = "工程详细地址", required = false)
	private String projectAddress;
	
	@JsonIgnore
	@ApiModelProperty(value="工种id字符串集合,用逗号分隔")
	private String WorkerTypeIdes;
	
	@ApiModelProperty(value = "工种集合")
	private List<WorkType> workTypeList;
	
	@ApiModelProperty(value = "上工时间")
    private Long workTime;
	@ApiModelProperty(value = "总的应付")
    private BigDecimal totalReceivable;
	@ApiModelProperty(value = "总的已付")
	private BigDecimal totalReceived;
	@ApiModelProperty(value = "总的未付")
	private BigDecimal totalUnpaid;
	
	@ApiModelProperty(value = "班组名称", required = false)
	private String teamName;
	
	public String getTeamName() {
		return teamName;
	}

	public void setTeamName(String teamName) {
		this.teamName = teamName;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getProjectCode() {
		return projectCode;
	}

	public void setProjectCode(String projectCode) {
		this.projectCode = projectCode;
	}

	public ProjectInfo getProjectInfo() {
		return projectInfo;
	}

	public void setProjectInfo(ProjectInfo projectInfo) {
		this.projectInfo = projectInfo;
	}

	public Integer getTeamId() {
		return teamId;
	}

	public void setTeamId(Integer teamId) {
		this.teamId = teamId;
	}

	public ItemInfo getItemInfo() {
		return itemInfo;
	}

	public void setItemInfo(ItemInfo itemInfo) {
		this.itemInfo = itemInfo;
	}

	public Integer getWorkTypeId() {
		return workTypeId;
	}

	public void setWorkTypeId(Integer workTypeId) {
		this.workTypeId = workTypeId;
	}

	public WorkType getWorkType() {
		return workType;
	}

	public void setWorkType(WorkType workType) {
		this.workType = workType;
	}

	public String getWorkTypeName() {
		return workTypeName;
	}

	public void setWorkTypeName(String workTypeName) {
		this.workTypeName = workTypeName;
	}

	public String getProjectArea() {
		return projectArea;
	}

	public void setProjectArea(String projectArea) {
		this.projectArea = projectArea;
	}

	public String getProjectAddress() {
		return projectAddress;
	}

	public void setProjectAddress(String projectAddress) {
		this.projectAddress = projectAddress;
	}

	public String getWorkerTypeIdes() {
		return WorkerTypeIdes;
	}

	public void setWorkerTypeIdes(String workerTypeIdes) {
		WorkerTypeIdes = workerTypeIdes;
	}

	public List<WorkType> getWorkTypeList() {
		return workTypeList;
	}

	public void setWorkTypeList(List<WorkType> workTypeList) {
		this.workTypeList = workTypeList;
	}

	public Long getWorkTime() {
		return workTime;
	}

	public void setWorkTime(Long workTime) {
		this.workTime = workTime;
	}

	public BigDecimal getTotalReceivable() {
		return totalReceivable;
	}

	public void setTotalReceivable(BigDecimal totalReceivable) {
		this.totalReceivable = totalReceivable;
	}

	public BigDecimal getTotalReceived() {
		return null == totalReceived ? new BigDecimal(0.00).setScale(2) : totalReceived;
	}

	public void setTotalReceived(BigDecimal totalReceived) {
		this.totalReceived = null == totalReceived ? new BigDecimal(0.00).setScale(2) : totalReceived;
	}

	public BigDecimal getTotalUnpaid() {
		return totalUnpaid;
	}

	public void setTotalUnpaid(BigDecimal totalUnpaid) {
		this.totalUnpaid = totalUnpaid;
	}
}